﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using DIS.Infrastructure.Entities.Entity;
using DIS.Infrastructure.Entities.Repository;
using DIS.Tool.Framework;

namespace DIS.Infrastructure.Entities
{
    public class SampleData : DropCreateDatabaseIfModelChanges<Context>
    {
        protected override void Seed(Context context)
        {
            var users = new List<T_User>
            {
                new T_User()
                {
                    Birthday="1986-09-19",
                    CreateDate=DateTime.Now,
                    Gender=true,
                    IdCardNo="",
                    IsActivate=true,
                    Password=AesAlgorithm.Encrypt("admin"),
                    Phone="13594081871",
                    Photo="",
                    QQ="565587360",
                    RealName="管理员",
                    SystemRole=10,
                    UserName="admin"
                }
            };
            users.ForEach(s => context.User.Add(s));
            context.SaveChanges();
        }
    }
}
